package com.wyz.note.basics.strategy;

/**
 * @Description: 测试主类
 * @author: wei yz
 * @Date: 2024/1/14 14:15
 */
public class StrategyTest {

    // 参考： https://www.cnblogs.com/visionit/p/6404678.html

    public static void main(String[] args) {
        PriceHandle priceHandle=new PriceHandle();
        //会员等级（0普通会员,1黄金会员,2钻石会员）
        int memberType=2;
        switch (memberType) {
            case 0:
                priceHandle.setMemberInterface(new NormalMemberServiceImpl());
                break;
            case 1:
                priceHandle.setMemberInterface(new GoldMemberServiceImpl());
                break;
            case 2:
                priceHandle.setMemberInterface(new DiamondMemberServiceImpl());
                break;
        }
        System.out.println(priceHandle.getMemberPrice(10.0));;
    }
}
